<template>
    <div class="day_order_buy">
        <div class="data-content">
            <Row type="flex" justify="space-between" class="code-row-bg mb10">
                <Col span="9">
                    <Form label-position="right" :label-width="140">
                        <FormItem label="Android：">
                            <Upload class="disinblock"
                                    :before-upload="handleUpload1"
                                    :action="action1">
                                <Button icon="ios-cloud-upload-outline">选择文件</Button>
                            </Upload>
                            <div class="disinblock pl10" v-if="file1 !== null">{{ file1.name }}
                                <Button class="ml10" @click="upload(1)" :loading="loadingStatus1"> 上传 </Button>
                            </div>
                            <div class="disinblock pl10" v-else>未选中任何文件</div>
                        </FormItem>
                    </Form>
                </Col>
                <Col span="15" class="c999 ercode">
                    <div>
                        <p>Android下载二维码</p>
                        <img src="./../../../assets/image/android.png" alt="" style="width: 130px">
                    </div>
                </Col>
            </Row>
            <Row type="flex" justify="space-between" class="code-row-bg">
                <Col span="9">
                    <Form label-position="right" :label-width="140">
                        <FormItem label="iPhone：">
                            <Upload class="disinblock"
                                    :before-upload="handleUpload2"
                                    :action="action2">
                                <Button icon="ios-cloud-upload-outline">选择文件</Button>
                            </Upload>
                            <div class="disinblock pl10" v-if="file2 !== null">{{ file2.name }}
                                <Button class="ml10" @click="upload(2)" :loading="loadingStatus2"> 上传 </Button>
                            </div>
                            <div class="disinblock pl10" v-else>未选中任何文件</div>
                        </FormItem>
                    </Form>

                </Col>
                <Col span="15" class="c999 ercode">
                    <div>
                        <p>IOS下载二维码</p>
                        <img src="./../../../assets/image/iphone.png" alt="" style="width: 130px">
                    </div>
                </Col>
            </Row>
        </div>
    </div>
</template>
<style>

</style>
<script>
    import WrapperContent from '../../../components/wrapper-content.vue'
    import {
        getUserList,
        getUser,
        getLevelList,
        getPositionList,
        doUserInfo,
        delUser,
        changeUserState
    } from "@/api/user";
    import * as utils from '../../../assets/js/utils'
    import $ from 'jquery'
    import _ from 'lodash'

    export default {
        components: {
            WrapperContent
        },
        data() {
            return {
                loading: false,
                formdata: {
                    am1: '',
                    am2: '',
                    pm1: '',
                    pm2: ''
                },
                send_loading: false,
                file1: null,
                loadingStatus1: false,
                action1: '',
                file2: null,
                loadingStatus2: false,
                action2: ''
            }
        },
        created: function () {
            this.loading = false;
        },
        methods: {
            handleSubmit() {
                this.send_loading = true;
                setTimeout(() => {
                    this.send_loading = false;
                }, 2000)
            },
            handleUpload1 (file) {
                this.file1 = file;
                return false;
            },
            handleUpload2 (file) {
                this.file2 = file;
                return false;
            },
            upload (type) {
                if(type == 1){
                    this.loadingStatus1 = true;
                    setTimeout(() => {
                        this.file1 = null;
                        this.loadingStatus1 = false;
                        this.$Message.success('Success')
                    }, 1500);
                }else{
                    this.loadingStatus2 = true;
                    setTimeout(() => {
                        this.file2 = null;
                        this.loadingStatus2 = false;
                        this.$Message.success('Success')
                    }, 1500);
                }
            }
        }
    }
</script>





























